function  plotResults( evaluations, class_labels )
%UNTITLED3 Summary of this function goes here
%   class_labels is 'angle' or 'type'

if strcmp(class_labels,'angle')~=0
    class_labels=['front'; 'side ' ; 'back '];

else
    class_labels=['tuck ';'car  ';'sport';'SUV  '];

end
figure()
subplot(111)
hold on
colors='robk';

for class_ind=1:size(class_labels,1);
    class_label=class_labels(class_ind);
    x_data=zeros(size(evaluations,1),1);
    y_data=zeros(size(evaluations,1),1);
    for eval_ind=1:size(evaluations,1)
        x_data(eval_ind)=evaluations(eval_ind).precision(class_ind-1);
        y_data(eval_ind)=evaluations(eval_ind).recall(class_ind-1);
    end
    scatter(x_data, y_data, 20, colors(class_ind))
    

end

%labels=reshape(class_labels,[size(class_labels,1),1]);
legend(class_labels,'location','best')
xlabel('Precision')
ylabel('Recall')
xlim([0,1])
ylim([0,1])

cmsum=confusionMatrix(evaluations);
if strcmp(class_labels(1,:),'front')
    disp('          a    b    c')
else
    disp('          a    b    c    d')
end
for i=1:size(class_labels,1)
    shortV=char(96+i);
    out=sprintf('%s=%s ',shortV, class_labels(i,:));
    for j=1:size(class_labels,1)
        out=[out,sprintf('%4u ',cmsum(i,j))];
    end
    disp(out)
end
end
    
    


